#/usr/bin/env python
import os,sys

from Tkinter import *

class PracticeTk(Tk):
    def __init__(self,*a,**kw):
        Tk.__init__(self,*a,**kw)
        self.protocol('WM_DELETE_WINDOW',self.quit)

class OneLinerPracticeApp(Frame):
    def __init__(self,*a,**kw):
        Frame.__init__(self,*a,**kw)
        self.inputEntry = Entry(self,)
        self.questionText = Text(self,state='disabled')
        self.feedbackText = Text(self,state='disabled')
        self.rowconfigure(0,weight=1)
        self.rowconfigure(1,weight=1)
        self.columnconfigure(0,weight=1)
        #self.columnconfigure(1,weight=1)
        self.questionText.grid(row=0,column=0,sticky='news')
        self.feedbackText.grid(row=1,column=0,sticky='news')
        self.inputEntry.grid(row=2,column=0,sticky='ew')
        self.inputEntry.focus_set()


        

class PracticeApp(Frame):
    def __init__(self,*a,**kw):
        Frame.__init__(self,*a,**kw)
        self.inputText = Text(self,bg='red',bd=2,relief='flat')
        self.questionText = Text(self,bg='blue',bd=2,relief='flat')
        self.feedbackText = Text(self,bg='green',bd=2,relief='flat')
        self.rowconfigure(0,weight=1)
        self.rowconfigure(1,weight=1)
        self.columnconfigure(0,weight=1)
        self.columnconfigure(1,weight=1)
        self.inputText.grid(row=0,column=0,rowspan=2,sticky='news')
        self.questionText.grid(row=0,column=1,sticky='news')
        self.feedbackText.grid(row=1,column=1,sticky='news')

    def quit(self,event):
        print event
        sys.exit(0)


if __name__=='__main__':
    tk = Tk()
    app = OneLinerPracticeApp()
    app.pack(expand=1,side='top',fill='both')

    tk.bind('<Escape>',lambda e,s=sys:s.exit())
    tk.mainloop()
